ints=eval(input('输入三个整数，以逗号分隔：'))
x=ints[0]
y=ints[1]
z=ints[2]
powsum=x*x*x+y*y*y+z*z*z
if powsum > 1000:
    print(powsum-1000)
else:
    print(sum(ints))
